import 'package:flutter/material.dart';
import 'package:flutter_demo/chapter8-EventNotification/event-mechanism/PointerDownListener.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Event Widget Demo"),
      ),
      body: WaterMaskWidget(),
    ),
  ));
}

class WaterMaskWidget extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        wChild(1, Colors.white, 200),
        // WaterMark(
        //   painter: TextWaterMarkPainter(text: 'wendux', rotate: -20),
        // ),
      ],
    );
  }

  wChild(int index, Color color, double size) {
    return Listener(
      onPointerDown: (e) => print(index),
      child: Container(
        width: size,
        height: size,
        color: Colors.grey,
      ),
    );
  }
}
